package Search;

import java.util.ArrayList;

import Main.Board;
import Main.Node;
import Search.AS1;
import Search.BFS;
import Search.DFS;
import Search.GR1;
import Search.GSearch;
import Search.IDS;
import Search.Problem;

public class MouseInAMaze extends Problem {

	public static void MiM(String strategy, boolean visualize) {

		GSearch MouseMaze = new GSearch();
		MouseMaze.initialState = new Node(' ', 0, new Board(6), 0, null);

		MouseMaze.operators = new ArrayList<Character>();
		MouseMaze.operators.add('u');
		MouseMaze.operators.add('d');
		MouseMaze.operators.add('r');
		MouseMaze.operators.add('l');
		
		MouseMaze.initialState.getBoard().display();
		System.out.println("*===================================*");

		Long t = System.currentTimeMillis();

		if (strategy.equalsIgnoreCase("AS1")) {
			AS1.search(MouseMaze.initialState);
		} else if (strategy.equalsIgnoreCase("AS2")) {
			AS2.search(MouseMaze.initialState);
		}else if (strategy.equalsIgnoreCase("GR1")) {
			GR1.search(MouseMaze.initialState);
		} else if (strategy.equalsIgnoreCase("GR2")) {
			GR2.search(MouseMaze.initialState);
		}else if (strategy.equalsIgnoreCase("BFS")) {
			BFS.search(MouseMaze.initialState);
		} else if (strategy.equalsIgnoreCase("DFS")) {
			DFS.search(MouseMaze.initialState);
		} else if (strategy.equalsIgnoreCase("IDS")) {
			IDS.search(MouseMaze.initialState);
		}
		System.out.println("Run Time: " + (System.currentTimeMillis() - t)
				+ " ms");
		System.out.println("Cost of the solution: " + GSearch.getSolutionCost()
				+ "");
		System.out
				.println("Nodes expanded: " + GSearch.getNodesExpanded() + "");

	}

	public static void main(String[] args) {
		MiM("AS2", false);
	}

}
